<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core">
	<head><title>IGNORED</title></head>
	<body>
		<ui:composition template="../templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market | Customer | Check Out</ui:define>
			<ui:define name="logoImage"><h:graphicImage library="images" name="logo_header.jpg" alt="logo" /></ui:define>
			<ui:define name="content">
				<div id="content" class="graphic_bg">
					<div class="form-row header">Confirm Order</div>
					<div class="form-row">Please make sure your order is correct before placing your order. </div>
					<h:messages globalOnly="true" styleClass="form-messages" fatalClass="form-messages error" errorClass="form-messages error" warnClass="form-messages warn" infoClass="form-messages" />
					<h:dataTable value="#{cartBean.cart}" var="cartItem" rendered="#{not cartBean.cartEmpty}" style="margin-top: 5px; border: solid 4px #FFFFFF; border-collapse: collapse;" rowClasses="odd-row, even-row" headerClass="header-row" columnClasses="id-col,data-col,data-col,data-col" >
						<h:column>
							<f:facet name="header">Deal</f:facet>
							<h:outputText value="#{cartItem.deal.shortDesc}" styleClass="deal-title detail" />
							<h:outputText value="#{cartItem.deal.companyDisplay}" styleClass="deal-company" />
						</h:column>
						<h:column>
							<f:facet name="header">Quantity</f:facet>
							<h:outputText value="#{cartItem.quantity}" />
						</h:column>
						<h:column>
							<f:facet name="header">Unit Price</f:facet>
							<h:outputText value="#{cartItem.deal.priceDisplay}" />
						</h:column>
						<h:column>
							<f:facet name="header">Total Price</f:facet>
							<h:outputText value="#{cartItem.totalLineItemPriceDisplay}" />
						</h:column>
					</h:dataTable>
					<h:panelGroup styleClass="checkout-panel">
						<h:form>
							<h:link outcome="cart" styleClass="image-button">
								<h:graphicImage library="images/icons/16" name="cart_edit.png" alt="b" title="Back to Cart" styleClass="with-text" />Back to Cart
							</h:link>
							<h:commandLink action="#{cartBean.doConfirmOrder}" styleClass="image-button" rendered="#{not cartBean.cartEmpty}" >
								<h:graphicImage library="images/icons/16" name="cart_go.png" alt="c" title="Check Out" styleClass="with-text" />Place Order
							</h:commandLink>
						</h:form>
					</h:panelGroup>
					<h:panelGroup styleClass="notification error" rendered="#{cartBean.cartEmpty}">There are no items in your cart!</h:panelGroup>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</html>
